package com.docking.heylo.enums;

public enum EPayMethod {

    Alipay(1,"支付宝"),
    WeChat(2,"微信"),
    balance(3, "余额"),
    other(4,"其它"),
    test(5,"测试")
    ;


    private int         value;
    private String      name;

    EPayMethod(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static EPayMethod getByValue(int value){
        for (EPayMethod payMethod : EPayMethod.values()){
            if(payMethod.getValue() == value){
                return payMethod;
            }
        }
        return null;
    }
}
